package adapter;

import be.kuleuven.cs.swop.api.ITime;

public class ATime implements be.kuleuven.cs.swop.api.ITime {

	private int minutes;
	private int hours;
	
	public ATime(int hours, int minutes){
		this.hours = hours;
		this.minutes=minutes;
	}
	
	@Override
	public int compareTo(ITime time) {
		if(hours<time.getHours())
			return -1;
		else if(hours>time.getHours())
			return 1;
		else if(hours==time.getHours()){
			if(minutes<time.getMinutes())
				return -1;
			else if(minutes>time.getMinutes())
				return 1;
			else
				return 0;
		}
		return 0;
	}

	@Override
	public int getHours() {
		return hours;
	}

	@Override
	public int getMinutes() {
		return minutes;
	}


}
